class Solution {
    public boolean checkZeroOnes(String s) {
        int a0 = 0, a1 = 0;
        int s0 = 0, s1 = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == '1') {
                a1++;
                a0 = 0;
            } else {
                a0++;
                a1 = 0;
            }
            s0 = Math.max(s0, a0);
            s1 = Math.max(s1, a1);
        }
        return s1 > s0;
    }
}